package com.tenebrous.jestic.controller;

import com.zy.tenebrous.jestic.algorithm.AbstractAlgorithmActiveHandlerProcessor;
import com.zy.tenebrous.jestic.annotation.UseCustomAlgorithm;
import com.zy.tenebrous.jestic.utils.AESCodec;

/**
 * @Description:
 * @Project: geovis.ops
 * @Package: com.rain.ops.portal.controller
 * @Author: zhangya
 * @CreateTime: 2023-05-10  11:00
 * @Version: 1.0.0
 */
@UseCustomAlgorithm
public class TestPro implements AbstractAlgorithmActiveHandlerProcessor {
    @Override
    public String encryption(String data, String key) {
        try {
            return AESCodec.encrypt(data,key);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }

    @Override
    public String decrypt(String data, String key) {
        try {
            return AESCodec.decrypt(data, key);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}
